var qcloud = require('../../vendor/wafer2-client-sdk/index')
var config = require('../../config')
var util = require('../../utils/util.js')

Page({
  /**
   * 页面的初始数据
   */
  data: {
    img_url:'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1535517206419&di=134a7285d082a14b1489dee7f25fcee0&imgtype=0&src=http%3A%2F%2Fimg.zcool.cn%2Fcommunity%2F0117e2571b8b246ac72538120dd8a4.jpg%401280w_1l_2o_100sh.jpg',
    arr:[]
  },
  but:function(){
    console.log('123')
  },
  sql_btn:function(){
    var that = this
    wx.request({
      //上线接口地址要是https测试可以使用http接口方式
      url: 'https://wx.gjzy.com/weixin/Admin/Index/getdownList',
      data: {
        pid:'1'
      },
      method: "POST",
      header: {
        'content-type': 'application/x-www-form-urlencoded'
      },
      success: function (res) {
        that.setData({
          text:res.data
        })
        console.log(res.data)
      },
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that = this
    wx.request({
      //上线接口地址要是https测试可以使用http接口方式
      url: 'https://wx.gjzy.com/weixin/Admin/Index/home_sele',
      data: {
        pid: '1'
      },
      method: "GET",
      header: {
        'content-type': 'application/json'
      },
      success: function (res) {
        that.setData({
          arr: res.data
        })
        console.log(res.data)
      },
    })
  },
  //点击之后跳转页面1
  url1:function(){
    wx:wx.redirectTo({
      url: '/pages/user/user',
      success: function(res) {},
      fail: function(res) {},
      complete: function(res) {},
    })
  },
  //点击之后跳转页面2
  url2:function(){
    wx:wx.redirectTo({
      url: '/pages/home/home',
      success: function(res) {},
      fail: function(res) {},
      complete: function(res) {},
    })
  }
})